// 店铺数据模型
const mongoose = require("mongoose");
const { Schema, model } = mongoose;

const shops = new Schema({
    name:{type:'String', default:'店铺名'},
    fmImg:{type: 'String'},
    boss:{type:Schema.Types.ObjectId, ref:'Users'},
    goodsArr:{type:[{
            title:{type:String},
            goods:[{type:Schema.Types.ObjectId, ref:'Goods'}]
        }]},
    category:{type:'Array'},  //店铺商品分类
    address:{type:'Object'}, //地址
    earnings:{type:'Number',default:0},  //店铺累计收益
},{
    timestamps:true
});

module.exports = model('Shops', shops)
